package demo;

import java.util.Scanner;

public class Demo4 {
	public static void main(String[] args) {
		int a, n,s=0, t=0;
		Scanner in = new Scanner(System.in);
		System.out.println("请输入a的值：");
		a = in.nextInt();
		System.out.println("请输入相加的项数：");
		n = in.nextInt();
		
		for( int i=1; i<=n; i++){
		t=(t*10)+a;
		
		
		s=s+t;}
		
System.out.println(s);
	}
}
